AWeb PowerPC JPEG Plugin | |
carrott.org | Contact |
Yvon Rozijn kindly sent my the source for his 68k jpeg decoder. I have ported it to vbcc and have built a WarpOS version. This would not have been possible without Yvon's source. Looking at the complexity of the interface between it and the jpeg library, I would probably have given up if I wrote it from scratch.
I must also thank Frank Wille for work on vlink and vbcc and the help he gave me with vbcc and WarpOS libraries. Also thanks to Volker Barthelmann for writing vbcc in the first place.
Currently this software should be considered BETA.While it does work here, I take no responsibility for it's actions. It hasn't had a huge amount of testing, especially in low memory situations, where it is possible with a very large number of temporary files to have trouble.
On my 040 25MHz 603e 175MHz, I get about a 1.5 - 2x speedup. Unfortunatly further speed gains will be difficult. I have looked carefully and there are two context switches (one to 68k and one back to PPC) during a call to a suitable WritePixel function for every line of the image. There is an additional pair of context switches for every update of the image on the screen, if you set the PROGRESS option to a larger number you can reduce this switch. It would be possible to get this display update without context any switch by doing it along with the WritePixel call, but it would complicted the code even more, and I don't think I will bother. There are an additional pair of context switches whenever the imput buffer runs out and more data has to be copied from aweb. I am unsure of the impact on performance of this, but I think it will be minimal, happening perhaps a half dozen times for a 50kB image retrieved from the lan. A slower network connection might have more of an impact here, possibly with a switch for every incomming packet.
It would probably be possible to buffer up the raw data and feed multiple lines to WritePixel with one context switch. I will have to examine why the buffer is allocated with a jpeg library function before I do this. This could have a significant effect on the speed.
I will compile 060 and 603e/604e versions, the current version is compiled with 68040 code and no PPC target specified. I will also look into where -amiga-align is needed (it ensures that structures passed to OS and 68k code from PPC code are aligned like a 68k processor would want them, and causes a performance penalty in the PPC code. I don't know how significant it is).
Please mail me and tell me of your experiance with the plugin. There have been over 200 downloads of this plugin, but I've had a total of 2 emails, and a few comments not directed at me that I've read about on amiga-news.de via Babelfish
If anyone is interested in a PowerUP port then that ought to be fairly easy, currently the only WarpOS commands used are RunPPC() and Run68K().
If anyone wants a MorphOS port then I wouldn't recomend using this source, I understand that MorphOS requires little more than a recompile from the 68k source. I have a working 68k only source here for VBCC, if someone wants me to recompile it for MorphOS the you can contact me with instructions on how to do it. Since this source is basically an unmodified version of Yvon's (maybe 20 lines are different from his SAS/C code in minor ways), I don't think I can distribute it.
v0.1 (20/05/01) | Low memory, invalid jpeg, and filename bugs. |
v0.2 (22/05/01) | Recompile with -O3 optimisations. Fixed filename bug. |
v0.3 (28/05/01) | Fixed invalid jpeg bugs, low memory bug possibly worse, remains due to typo. Reduced context switching during buffer refill. |
v0.4 (29/05/01) | Fixed low memory bug (really!). |
To install this plugin please first install the 68k version of the jpeg decoder. You will find this on the Aweb homepage. Now copy the PPC plugins to your plugin directory (usually AWeb3:AWebPlugin). Finally, edit your Browser Settings and click the viewers tab. Select the jfif plugin and choose your favourite PPC decoder instead of the 68k plugin. The arguments for the PPC plugin are the same as those for the 68k plugin. You might want to experiment with higher values of the PROGRESS paramater, as this will (marginally) reduce the context switches.
I currently have few problems using the following arguments, (don't forget to press enter after pasting this into aweb's preferences) PROGRESS=50 MULTIPASS=0 DITHER=2
If you have problems with the installation, be sure that you have got the filenames correct. Do not change the names of the plugins, as aweb will silently ignore them if the filenames are incorrect. If you have trouble, then use the debug version of the plugin and install a serial terminal or something like sashimi (from aminet). You should recieve a LOT of debug output. This will be useful for pinpointing where things go wrong. If you get no output at all, then it is likely that aweb isn't loading the plugin for some reason.
copyright 2001 Tom Parker - last modified 28 May 2001